package com.thinkfit.jy.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.common.lib.bean.VideoListBean;
import com.common.lib.bean.VideoSectionBean;
import com.thinkfit.jy.R;
import com.thinkfit.jy.utils.DeviceTypeUtils;
import com.thinkfit.jy.utils.ImageLoadUtils;
import com.thinkfit.jy.utils.MotionDataUtils;

import org.jetbrains.annotations.NotNull;

public class CourseSectionAdapter extends BaseQuickAdapter<VideoSectionBean, BaseViewHolder> {

    private Context mContext;

    public CourseSectionAdapter(Context context) {
        super(R.layout.item_course_section);
        mContext = context;
    }


    @Override
    protected void convert(@NotNull BaseViewHolder helper, VideoSectionBean bean) {
        TextView tvSpeedTip = helper.getView(R.id.tv_speed_tip);
        TextView tvItemSpeed = helper.getView(R.id.tv_item_speed);
        TextView tvItemTime = helper.getView(R.id.tv_item_time);
        if(DeviceTypeUtils.getInstance().isTreadmill()){
            tvSpeedTip.setText(mContext.getString(R.string.app_video_info_target_speed_hint));
            tvItemSpeed.setText(String.valueOf(bean.getSpeed()));
        }else {
            tvSpeedTip.setText(mContext.getString(R.string.app_video_info_target_slop_hint));
            tvItemSpeed.setText(String.valueOf(bean.getDrag()));
        }

        tvItemTime.setText(String.valueOf(bean.getLongtime()));
    }


}
